package com.ruoyi.project.bajiaostar.user;

import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.project.bajiaostar.jbhWemember.domain.JbhWemember;
import com.ruoyi.project.bajiaostar.jbhWemember.service.IJbhWememberService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 会员信息Controller
 * 
 * @author 写烧糊
 * @date 2024-07-18
 */
@Controller
@RequestMapping("/nt/jbhWemember")
public class WebWememberController extends BaseController
{

    @Autowired
    private IJbhWememberService jbhWememberService;


    /**
     * 新增保存会员信息
     */
    @Log(title = "会员信息", businessType = BusinessType.INSERT)
    @PostMapping("/add")
    @ResponseBody
    public AjaxResult addSave(@RequestBody  JbhWemember jbhWemember)
    {
        return toAjax(jbhWememberService.insertJbhWemember(jbhWemember));
    }


    /**
     * 查询会员信息列表
     */
    @PostMapping("/list")
    @ResponseBody
    public TableDataInfo list(@RequestBody  JbhWemember jbhWemember)
    {
        startPage(jbhWemember.getPageNum(),jbhWemember.getPageSize());
        List<JbhWemember> list = jbhWememberService.selectJbhWememberList(jbhWemember);
        return getDataTable(list);
    }

    /**
     * 查询审核会员信息
     */
    @GetMapping("/edit/{authId}")
    public AjaxResult edit(@PathVariable("authId") Long authId)
    {
        JbhWemember jbhWemember = jbhWememberService.selectJbhWememberById(authId);
        return AjaxResult.success(jbhWemember);
    }
}
